import './assets/main.css'

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import axios from 'axios'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from
  'element-plus/es/locale/lang/zh-cn'
import BaiduMap from 'vue-baidu-map-3x'

//axios拦截器
axios.interceptors.request.use(config => {
    config.baseURL="http://47.96.140.177:8000/"
    //Token
    if (localStorage.token!=null) {
      config.headers.Authorization="Bearer " + localStorage.token
    }
    return config
  })
const app = createApp(App)
//
app.use(ElementPlus, {
  locale: zhCn,
})
app.use(BaiduMap, {
  // ak 是在百度地图开发者平台申请的密钥 详见 http://lbsyun.baidu.com/apiconsole/key */
  ak: 'CaT37xB2PQsd5Ta90SjqzpI8Z1jCVJZr',
  // v:'2.0',  // 默认使用3.0
  // type: 'WebGL' // ||API 默认API  (使用此模式 BMap=BMapGL)
//
//
});
app.use(createPinia())
app.use(router)

app.mount('#app')
